<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2023/3/8
  Time: 16:18
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="UTF-8">
    <title>上架商品</title>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/global.css"/>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/header.css"/>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/font_1613397_3cmr5ide1fe.css"/>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/MicroLoader.css"/>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/Header.a3dc4fd1.chunk.css"/>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/smart-category-qn.css"/>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/app.85fbbb1e.css"/>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-3.6.3.min.js"></script>
    <style>
        .content .bigZoom {
            zoom: 150%;
        }
        #root{
           margin-top: 40px;
            margin-bottom: 100px;
        }
        #tagvale span{
            margin: 0px;
            padding: 0px;
            margin-right: 10px;
            line-height: 18px;
            vertical-align: top;
        }
        .addTag{
            z-index: 9;
            position: fixed;
            width: 630px;
            border-radius: 16px;
            top: 30%;
            left: 50%;
            transform: translate(-50%, -50%);
        }
    </style>
</head>

<body>
<c:if test="${not empty msg}">
    <script>
        alert('${msg}');
    </script>
    <c:remove var="msg"></c:remove>
</c:if>


<div id="qn_header">
    <div class="Header_container__FuAZ2">
        <div class="Header_wrap__5vUYw">
            <div class="Header_left__V+n7k">
<%--                <img src="" alt="">--%>
<%--                <i class="next-icon "></i>--%>
                <a href="${pageContext.request.contextPath}/con/show.html?id=${Bus.id}&osid=5">
                    <svg t="1678418644500" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2789" width="30" height="30">
                        <path d="M891.18208 499.97824 529.1008 134.10944c-8.032-8.1152-20.864-8.14976-28.93568-0.0768L354.14528 280.05632 354.14528 243.3024c0-11.82336-9.28384-21.408-20.73856-21.408s-20.73856 9.58464-20.73856 21.408l0 78.2336L134.30784 499.90016c-4.07296 4.07424-6.35008 9.68832-6.30784 15.54176 0.04352 5.85344 2.4064 11.43296 6.53952 15.44064l101.0304 97.95968 0.92672 245.93152c0.04352 11.79136 9.31584 21.3248 20.73856 21.3248l509.33888 0c11.45344 0 20.73856-9.58464 20.73856-21.408L787.31264 628.96l103.38304-97.90592c4.19584-3.9744 6.62528-9.55392 6.71744-15.43168C897.50528 509.74592 895.2512 504.0896 891.18208 499.97824zM752.55296 603.77088c-4.2816 4.05376-6.71872 9.77664-6.71872 15.77472l0 233.73312-467.9424 0-0.87936-233.81632c-0.02304-5.88288-2.3872-11.4944-6.53952-15.52256l-91.68896-88.90496L514.5216 179.28832l332.01024 335.48416L752.55296 603.77088z" p-id="2790">
                        </path>
                    </svg>
                </a>
                <div class="Header_divider__ixxgl"></div>
                <div class="Header_title__vxt4F">商品发布</div>
            </div>
            <div class="Header_middle__J5g+F"></div>
            <div class="Header_right__FSYrj">
                <div class="CustomerService_Container__gk40G">
                    <div class="CustomerService_BtnContainer__M-m7G">
                        <div class="CustomerService_BtnIcon__ZocTl">
                        </div>
                        <div>帮助</div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div id="root">
    <div class="" id="ROOT" style="display: block;">
        <div class="" id="smart-publish-header" style="display: block;">
            <div class="sell-feedback-message">
                <div class="next-message next-message-notice next-medium">
                    <i class="next-icon next-medium"></i>
                </div>
            </div>
        </div>
        <form action="listingGoods.do" method="post" enctype="multipart/form-data" onsubmit="return verifyFrom()">
            <input name="businessId" value="${Bus.id}" hidden>
            <div class="" id="struct-step-0" style="display: block;">
                <div class="next-loading sell-block-qn">
                    <div class="next-loading-wrap">
                        <div class="content">
                            <!--商品图片-->
                            <div id="struct-catImages">
                                <div class="sell-qn-vertical-layout-label-wrap ">
                                    <div class="sell-qn-vertical-layout-label">
                                        <label class="label required">1. 上传商品主图</label>
                                    </div>
                                </div>
                                <div class="sell-qn-vertical-layout-info top">
                                    <div class="sell-rich-text sell-o-rich-text top">
                                        上传高清正面商品主图，可快速智能识别及填充商品信息，帮您智能选择发布类目，上传清晰商品正面图，自动生成白底图
                                    </div>
                                </div>
                                <div class="sell-qn-vertical-layout-content">
                                    <div class="content has-label" style="width: 100%;">
                                        <div class="sell-images">
                                            <div class="image-uploader">
                                                <div class="drag-image-item-wrapper" draggable="true">
                                                    <div class="sell-o-image-item" style="width: 100px; height: 100px;">
                                                        <p class="placeholder"><span class="required">＊</span> 商品主图</p>
                                                        <div class="image-upload-btn">
                                                            <div class="upload-content">
                                                                <i class="next-icon next-icon-add next-large upload-btn-icon"
                                                                   data-spm-anchor-id="a213gs.26037775.0.i1.f2797a86uu0XoI"></i>
                                                                <p class="upload-text">添加上传图片</p>
                                                            </div>
                                                            <input data-nam="主图" name="PImg" type="file" hidden="hidden"
                                                                   accept="image/*"  class="loadimg verify"/>
                                                        </div>
                                                        <div class="sell-o-image-item-preview">
                                                            <div class="image-tools">
                                                                <i class="next-icon next-iconcarousel-arrcarousel-arrow-left-enter next-small tool move-left"></i>
                                                                <i class="next-icon next-icon-ashbin next-small tool image-upload-remove"></i>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="drag-image-item-wrapper" draggable="true">
                                                    <div class="sell-o-image-item" style="width: 100px; height: 100px;">
                                                        <p class="placeholder"></p>
                                                        <div class="image-upload-btn">
                                                            <div class="upload-content">
                                                                <i class="next-icon next-icon-add next-large upload-btn-icon"></i>
                                                                <p class="upload-text">添加上传图片</p>
                                                            </div>
                                                            <input name="PImg" type="file" hidden="hidden"
                                                                   accept="image/*" class="loadimg"/>
                                                        </div>
                                                        <div class="sell-o-image-item-preview">
                                                            <div class="image-tools">
                                                                <i class="next-icon next-iconcarousel-arrcarousel-arrow-left-enter next-small tool move-left"></i>
                                                                <i class="next-icon next-icon-ashbin next-small tool image-upload-remove"></i>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="drag-image-item-wrapper" draggable="true">
                                                    <div class="sell-o-image-item" style="width: 100px; height: 100px;">
                                                        <p class="placeholder"> 商品正面图</p>
                                                        <div class="image-upload-btn">
                                                            <div class="upload-content">
                                                                <i class="next-icon next-icon-add next-large upload-btn-icon"></i>
                                                                <p class="upload-text">添加上传图片</p>
                                                            </div>
                                                            <input name="PImg" type="file" hidden="hidden"
                                                                   accept="image/*" class="loadimg"/>
                                                        </div>
                                                        <div class="sell-o-image-item-preview">
                                                            <div class="image-tools">
                                                                <i class="next-icon next-iconcarousel-arrcarousel-arrow-left-enter next-small tool move-left"></i>
                                                                <i class="next-icon next-icon-ashbin next-small tool image-upload-remove"></i>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="sell-qn-vertical-layout-info"></div>
                                </div>
                            </div>
                            <div class="next-message next-message-notice next-medium">
                            </div>


                            <div id="struct-category">
                                <div class="sell-qn-vertical-layout-label-wrap ">
                                    <div class="sell-qn-vertical-layout-label">
                                        <label class="label required">商品名称</label>
                                    </div>
                                </div>
                                <div class="next-message next-message-notice next-medium">
                                    <i class="next-icon next-medium"></i>
                                </div>
                                <div>
                                    <span class="sell-o-error-hoc">
                                        <span class="sell-o-input sell-input large-input">
                                            <span class="input-wrap">
                                                <span class="next-input next-medium fusion-input">
                                                    <input class="verify" data-nam="商品名称" name="goodsName" placeholder="商品名称" maxlength="10" height="100%" type="text" step="0.01"  value="">
                                                </span>
                                            </span>
                                        </span>
                                    </span>
                                </div>
                            </div>
                            <div class="next-message next-message-notice next-medium">
                            </div>
                            <hr/>
                            <!--商品类型-->
                            <div id="struct-category">
                                <div class="sell-qn-vertical-layout-label-wrap ">
                                    <div class="sell-qn-vertical-layout-label">
                                        <label class="label required">2. 商品类型</label>
                                    </div>
                                </div>

                                <div class="sell-qn-vertical-layout-info top">
                                    <div class="sell-rich-text sell-o-rich-text top"></div>
                                </div>

                                <div class="next-message next-message-notice next-medium">
                                    <i class="next-icon next-medium"></i>
                                </div>
                                <!--列表-->
                                <div class="sell-category-select-with-select-prop">
                                    <div class="next-loading next-loading-inline sell-o-category-selection">
                                        <div class="next-loading-wrap">
                                            <div class="cascade-selection category-lists-wrap"
                                                 style="max-width: 683px;">
                                                <div class="next-loading next-loading-inline"
                                                     style="height: 100%; width: 227px; margin-left: 0px;">
                                                    <div class="next-loading-wrap">
                                                        <div id="chileck-category" class="category-list">
                                                            <div class="search-wrap">
                                                                <span class="next-input next-medium search-input">
                                                                    <p style="margin: 0px ;line-height:28px"></p>
                                                                    <input class="verify" data-nam="商品类型" name="type" height="100%" hidden="hidden"
                                                                           value="">
                                                                </span>
                                                                <i class="next-icon  next-icon-app next-small search-icon"></i>
                                                            </div>
                                                            <div class="list-frame">
                                                                <ul class="group-wrap">

                                                                </ul>
                                                                <div class="list-info"></div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>


                            <div class="next-message next-message-notice next-medium">
                                <i class="next-icon next-medium"></i>
                            </div>
                            <hr/>
                            <!--商品标签-->
                            <div id="struct-category">
                                <div class="sell-qn-vertical-layout-label-wrap ">
                                    <div class="sell-qn-vertical-layout-label">
                                        <label class="label">3. 商品标签</label>
                                    </div>
                                </div>
                                <div class="next-message next-message-notice next-medium">
                                    <i class="next-icon next-medium"></i>
                                </div>

                                <div id="btn-category">
                                    <div id="taglist"></div>
                                    <div style="margin-bottom: 10px;"></div>
                                    <div><i id="Re" style="zoom: 150%;" class="next-icon next-icon-refresh"></i></div>
                                </div>
                                <div id="struct-publishType" class="sell-qn-vertical-layout ">
                                    <div class="sell-qn-vertical-layout-content">
                                        <div class="content has-label" style="width: 100%;">
                                            <span class="sell-radio hoz">

                                            </span>
                                        </div>
                                        <div class="sell-qn-vertical-layout-info"></div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="next-loading sell-block-qn">
                    <div class="next-loading-wrap">
                        <div class="content">
                            <div id="struct-category">
                                <div class="sell-qn-vertical-layout-label-wrap ">
                                    <div class="sell-qn-vertical-layout-label">
                                        <label class="label required">4. 价格</label>
                                    </div>
                                </div>
                                <div class="next-message next-message-notice next-medium">
                                    <i class="next-icon next-medium"></i>
                                </div>
                                <div>
                                    <span class="sell-o-error-hoc">
                                        <span class="sell-o-input sell-input large-input">
                                            <span class="input-wrap">
                                                <span class="next-input next-medium fusion-input">
                                                    <input class="verify" data-nam="价格" placeholder="价格" maxlength="10" height="100%"
                                                          name="Price" type="number" step="0.01" value="">
                                                </span>
                                            </span>
                                        </span>
                                    </span>
                                </div>
                            </div>

                            <div class="next-message next-message-notice next-medium">
                                <i class="next-icon next-medium"></i>
                            </div>
                            <div id="struct-catImages">
                                <div class="sell-qn-vertical-layout-label-wrap ">
                                    <div class="sell-qn-vertical-layout-label">
                                        <label class="label">5. 商品介绍</label>
                                    </div>
                                </div>
                                <div class="next-message next-message-notice next-medium">
                                    <i class="next-icon next-medium"></i>
                                </div>
                                <div>
                                    <h2>商品描述</h2>
                                    <span class="sell-o-error-hoc">
                                        <span class="sell-o-input sell-input large-input">
                                            <span class="input-wrap">
                                                <span class="next-input next-medium fusion-input">
                                                    <input name="desc" placeholder="商品描述" maxlength="200" height="100%" type="text" step="0.01"  value="">
                                                </span>
                                            </span>
                                        </span>
                                    </span>
                                </div>
                                <div>
                                    <h2>关键字</h2>
                                    <span class="sell-o-error-hoc">
                                        <span class="sell-o-input sell-input large-input">
                                            <span class="input-wrap">
                                                <span class="next-input next-medium fusion-input">
                                                    <input name="keywords" placeholder="关键字" maxlength="200" height="100%" type="text" step="0.01"  value="">
                                                </span>
                                            </span>
                                        </span>
                                    </span>
                                </div>
                                <div class="sell-qn-vertical-layout-content">
                                    <div class="content has-label" style="width: 100%;">
                                        <div class="sell-images">
                                            <div class="image-uploader">
                                                <h2>商品介绍图</h2>
                                                <div id="PHtml">
                                                    <div class="drag-image-item-wrapper" draggable="true">
                                                    <div class="sell-o-image-item" style="width: 100px; height: 100px;">
                                                        <p class="placeholder"></p>
                                                        <div class="image-upload-btn">
                                                            <div class="upload-content">
                                                                <i class="next-icon next-icon-add next-large upload-btn-icon"></i>
                                                                <p class="upload-text">添加上传图片</p>
                                                            </div>
                                                            <input name="PHtmlImg" type="file" hidden="hidden"
                                                                   accept="image/*"    class="loadimg"/>
                                                        </div>
                                                        <div class="sell-o-image-item-preview">
                                                            <div class="image-tools">
                                                                <i class="next-icon next-iconcarousel-arrcarousel-arrow-left-enter next-small tool move-left"></i>
                                                                <i class="next-icon next-icon-ashbin next-small tool image-upload-remove"></i>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                                </div>
                                                <div id="addHtmlImg" class="drag-image-item-wrapper" draggable="true">
                                                    <div class="sell-o-image-item" style="width: 50px; height: 100px;">
                                                        <div class="">
                                                            <div class="upload-content">
                                                                <i class="next-icon next-icon-add next-large upload-btn-icon"></i>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div id="delHtmlImg" class="drag-image-item-wrapper" draggable="true">
                                                    <div class="sell-o-image-item" style="width: 0px; height: 100px;">
                                                        <div class="">
                                                            <div class="upload-content">
                                                                <i class="next-icon next-icon-minus next-large upload-btn-icon"></i>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="sell-qn-vertical-layout-info"></div>
                        </div>
                    </div>
                </div>
                <div class="" id="struct-submit-0" style="height: 66px; line-height: 66px;">
                    <div class="sell-add-overlay">
                        <!--<button _id="submit-category" type="button" class="next-btn next-large next-btn-primary" style="margin-right: 0px;">
                            <span class="next-btn-helper">确认类目，继续完善</span>
                        </button>-->

                        <input type="submit" class="next-btn next-large next-btn-primary" value="上架商品"
                               style="margin-top: 15px; margin-right: 5%;"/>
                        <div class="sell-add-overlay-content"></div>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>


<div class="el-dialog addTag" style="margin-top: 15vh;display: none;">
    <div class="el-dialog__header">
        <span class="el-dialog__title">添加商品属性</span>
        <button type="button" aria-label="Close" onclick="closeAdd()" class="el-dialog__headerbtn">
            <i class="next-icon next-icon-minus " style="zoom: 150%"></i>
        </button>
    </div>
    <hr />
    <div class="el-dialog__body">
        <div class="detail">
            <form method="post" id="tagAdd" class="el-form el-form--label-right">
                <div class="form-data">
                    <div class="el-form-item is-required sku-val">
                        <label  class="el-form-item__label" style="width: 15%;">标签名称</label>
                        <div class="el-form-item__content" >
                            <div class="el-input">
                                <input name="name" placeholder="0" height="100%" class="el-input__inner">
                            </div>
                        </div>
                        <label class="el-form-item__label" style="width: 15%;">标签值</label>
                        <div class="el-form-item__content" >
                            <div class="el-input">
                                <input name="val" placeholder="值以  间隔，如：S号 M号" height="100%" class="el-input__inner">
                            </div>
                        </div>
                    </div>
                    <div style="z-index: 1; height: 50px;">
                        <div class="sub-navbar" style="z-index: 1; height: 50px;">
                            <button type="button" onclick="submitTag()" class="el-button el-button--success" style="margin-left: 10px;">
                                <span>添加</span>
                            </button>
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>

<div style="display: block; margin-bottom: 500px"></div>
<script>
    //上传图片
    $(".image-upload-btn").click(imgbtn);
    function imgbtn () {
        var t = $(this).next();
        if (t.find(".image-card").length == 0) {
            var str = '<div class="image-card"><img src="" alt="url" /></div>';
            t.html(str + t.html());
            t.parent().addClass("has-url")
            var img = $(this).children(".loadimg");
            t.find(".image-upload-remove").click(
                function () {
                    t.parent().removeClass("has-url");
                    t.find(".image-card").remove()
                }
            )
            img.click();
        }
    }
    $('.loadimg').change(loadImgChang)
    function loadImgChang () {
        var r = new FileReader();
        var file = $(this).get(0).files[0];
        var t = $(this);
        r.readAsDataURL(file);
        r.onload = function (e) {
            t.parent().next().find(".image-card img").attr("src", this.result)
        }
    }
    $('#addHtmlImg').click(function (){
        let str='<div class="drag-image-item-wrapper" draggable="true">' +
            '<div class="sell-o-image-item" style="width: 100px; height: 100px;">' +
            '<p class="placeholder"></p>' +
            '<div class="image-upload-btn" >' +
            '<div class="upload-content">' +
            '<i class="next-icon next-icon-add next-large upload-btn-icon"></i>' +
            '<p class="upload-text">添加上传图片</p>' +
            '</div>' +
            '<input name="PHtmlImg" accept="image/*" type="file" hidden="hidden"class="loadimg"/>' +
            '</div>' +
            '<div class="sell-o-image-item-preview">' +
            '<div class="image-tools">' +
            '<i class="next-icon next-iconcarousel-arrcarousel-arrow-left-enter next-small tool move-left"></i>' +
            '<i class="next-icon next-icon-ashbin next-small tool image-upload-remove"></i>' +
            '</div>' +
            '</div>' +
            ' </div>';
        $("#PHtml").append(str);
        $(".image-upload-btn").click(imgbtn);
        $('.loadimg').change(loadImgChang)
    })
    $('#delHtmlImg').click(function (){
        $("#PHtml").children().eq(-1).remove();
    })
</script>
<script>
    //选择商品类型
    function typeload(){
        $("#chileck-category .group-title").click(function () {
            var show = $(this).next().css('display');
            show == 'block' ? 'none' : show
            var i = $(this).children("i")
            if (show == 'block') {
                i.removeClass("next-icon-arrow-down");
                i.addClass("next-icon-arrow-right");
                show = 'none';
            } else {
                show = 'block';
                i.removeClass("next-icon-arrow-right");
                i.addClass("next-icon-arrow-down");
            }
            $(this).nextAll().css('display', show);
            $("#chileck-category .search-wrap input").attr('value',$(this).data("typeid"));
            $("#chileck-category .search-wrap p").text($(this).children("span").text());
            $("#struct-publishType .sell-radio").children().remove();
            getTag($(this).data("typeid"));
            addTag()
        })
        $("#chileck-category .category-item p").click(clickType)
        function clickType () {
            $("#chileck-category .search-wrap input").attr('value',$(this).data("typeid"));
            $("#chileck-category .search-wrap p").text($(this).text());
            $("#struct-publishType .sell-radio").children().remove();
            getTag($(this).data("typeid"));
            addTag()
        }
    }
        var AtteList;
        function getTag(typeid){
            $.ajax({
                url:"queryAttr.do",
                async:false,
                data: {type:typeid},
                dataType:"json",
                success:function (data) {
                    AtteList=data;
                },
                error:function (){
                    alert("失败")
                }
            })
        }


        function addTag(){
            let str='';
            for (let i = 0; i < AtteList.length; i++) {
                str+='<a data-attid='+AtteList[i].attrNameId+'>'+AtteList[i].attrName+'</a>&nbsp;';
            }
            str+='<span style="margin-left: 50px;pxcursor:pointer;" onclick="opAdd()"><i class="next-icon next-icon-add bigZoom"></i></span>'
            $("#btn-category #taglist").html(str);
            $("#btn-category #taglist a").click(function (){
                let obj=$(this);
                let index=obj.data('attid');
                $.ajax({
                    url:"queryAttrval.do",
                    async:false,
                    data: {attrId:index},
                    dataType:"json",
                    success:function (data) {
                        obj.remove();
                        if(data.length<=0)return;
                        let tegval='';
                        tegval+='<div style="margin-bottom: 10px" id="tagvale"><input type="checkbox" value="'+index+'" checked="checked" name="tag" hidden ><span class="radio-item">'+obj.text()+': <label>'
                        for (let i = 0; i < data.length; i++) {
                            tegval+='<input name="'+index+'" value="'+data[i].attr_value_id+'" type="checkbox" onchange="cboxchoen(this)" class="bigZoom"/>' +
                                '<input name="'+index+'valName" value="'+data[i].attr_value+'" type="checkbox" class="bigZoom" hidden/>'+
                                '<span class="item-label">'+data[i].attr_value+'</span>'
                        }
                        tegval+='</label></span>'
                        // tegval+='<i class="next-icon next-icon-add next-large upload-btn-icon"></i>'
                        //==============添加额外标签 另做===============
                        tegval+='</div>'
                        $("#struct-publishType .sell-radio").append(tegval)

                    },
                    error:function (){
                        alert("失败")
                    }
                })
            })
        }

    function cboxchoen(obj){
        $(obj).next("input").get(0).checked=obj.checked;
    }
</script>
<script>
    $.ajax({
        url:"queryCetegory.do",
        async:false,
        data: {},
        dataType:"json",
        success:function (data) {
            types=data;
        },
        error:function (){
            alert("失败")
        }
    })
    var types;
    var str='';
    addType(types)
    $(".list-frame>.group-wrap").html(str);
    typeload();
    function addType(typeLies){
        for (let c = 0; c < typeLies.length;c++) {
            str+='<li class="group-item">';
            if (typeLies[c].xj.length > 0) {
                str += '<div class="group-title" data-typeid="' + typeLies[c].cid + '">' +
                            '<span>' + typeLies[c].ctitle + '</span>' +
                            '<i class="next-icon next-icon-arrow-right next-xs"></i>' +
                        '</div>' +
                        '<div style="display: none;"><ul class="group-wrap">';
                            this.addType(typeLies[c].xj);
                str+="</ul></div>"
            }else{
                str += '<ul class="group-wrap"><li class="category-item">'
                str += '<div class="pre-item"></div>'
                str += '<p  data-typeid="' + typeLies[c].cid + '" class="text">' + typeLies[c].ctitle + '</p>'
                str += '<span class="icon-wrap"><i class="next-icon next-icon-arrow-right next-xs leaf-icon"></i></span></li></ul>'
            }
            str+='</li>';
        }
    }
</script>
<script>
    function verifyFrom(){
        let flag=true;
        $(".verify").each(function (){
            if($(this).val()==null || $(this).val()==""){
                alert($(this).data("nam")+"不可为空")
                flag=false;
                return flag;
            }
        })
        return flag;
    }
</script>

<script>
    function closeAdd(){
        $("#tagAdd input").val("");
        $(".addTag").css("display","none");
    }
    function opAdd(){
        $(".addTag").css("display","block");
    }
    function submitTag(){
        var fromData=new FormData();
        fromData.append("name",$("#tagAdd input[name='name']").val())
        fromData.append("val",$("#tagAdd input[name='val']").val())
        fromData.append("type",$("#chileck-category .search-wrap input").val())
        $.ajax({
            type:"post",
            url:"addTag.do",
            async:false,
            data:fromData,
            processData:false,//数据不做处理
            contentType:false,
            dataType:"text",
            success:function (data) {
                alert(data);
                getTag($("#chileck-category .search-wrap input").val())
                addTag()
                closeAdd()
                $("#struct-publishType .sell-radio").html("");
            },
            error:function (){
                alert("异常操作")
            }
        })
    }
</script>

</body>

</html>